﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Golf.WebUI.Customers
{
    public partial class AccountDetails : System.Web.UI.Page
    {
        /// <summary>
        /// 登陆用户的id
        /// </summary>
        public int userid = 0;

        public string txtName;
        public string lastName;
        public string NewEmail;
        public string NewEmail1;
        public string ConfirmMail;
        public string oldPwd;
        public string NewPwd;
        public string NewPwd1;

        Golf.Model.Golf_User model = new Model.Golf_User();
        Golf.BLL.Golf_User bll = new BLL.Golf_User();
        Golf.Model.Golf_UserData userdate = new Model.Golf_UserData();
        Golf.BLL.Golf_UserData datebll = new BLL.Golf_UserData();

        /// <summary>
        /// 获取主机名称
        /// </summary>
        public string http_Host = "";
        protected void Page_Load(object sender, EventArgs e)
        {
            http_Host = ThumNail.GetHttpHost();
            Object obj = CookiesHelper.GetCookie("_Customer_id");
            if (obj == null || obj.ToString() == "")
            {
            }
            else
            {
                userid = int.Parse(obj.ToString());
            }
            if (!IsPostBack)
            {
                SetMessage(userid);
            }
        }
        /// <summary>
        /// 修改赋值
        /// </summary>
        /// <param name="id"></param>
        public void SetMessage(int id)
        {
            model = bll.GetModel(id);
            if (model == null) return;
            this.txtName = model.FristName;
            this.lastName = model.LastName;
            // bll.Update(model);
            // List<Golf.Model.Golf_UserData> list = datebll.DataTableToList(datebll.GetList(" userid=" + id).Tables[0]);
            // foreach (var item in list)
            // {
            //     userdate = item;
            // }

            //this.postcode= userdate.PostCode;
            // datebll.Update(userdate);

        }
    }
}
